<!--
 * @Descripttion: 折扣率
 * @version:
 * @Author: cxguo
 * @Date: 2020-04-12 19:13:35
 * @LastEditors: cxguo
 * @LastEditTime: 2020-06-21 16:07:59
 -->
<template>
  <el-select
    v-model="insideValue"
    class="discount-type"
    filterable
    placeholder="请选择"
    v-on="$listeners"
  >
    {{ insideValue }}
    <el-option
      v-for="item in [{value:'0', label:'折扣率(%)'}, {value:'1', label:'折扣额(元)'}]"
      :key="item.value"
      :label="item.label"
      :value="item.value"
    />
  </el-select>
</template>

<script>
export default {
  props: {
    value: {
      type: [String, Number],
      default: '0'
    }
  },
  data() {
    return {
      insideValue: ''
    }
  },
  watch: {
    value: {
      handler(val) {
        this.insideValue = String(val)
      },
      immediate: true
    }
  },
  methods: {
  }
}
</script>
<style lang="scss" scoped>
.discount-type{
   /deep/.el-input__inner{width: 150px;}
 }
</style>
